package com.bestcem.xm.user.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.stream.Stream;

/**
 * 邮箱内容枚举
 *
 * @author panyun <yun.pan@idiaoyan.cn>
 * @date 2022/05/28 23:00
 * @version v1.0
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum EmailContentEnum {

    /**
     * 邮箱内容枚举
     */
    FAST_REGISTER(1,"快速登录注册"),
    MOBILE_REGISTER(2,"手机号+密码注册"),
    WECHAT_REGISTER(3,"微信注册并绑定手机"),
    LOGIN_BIND_MOBILE(4,"再次登录绑定手机"),
    DELIVER_BIND_MOBILE(5,"发布项目时绑定手机"),
    USER_INFO_BIND_MOBILE(6,"个人中心绑定手机"),
    WECHAT_MINI_PROGRAM(7,"微信小程序"),
    MOBILE_H5_REGISTER(8,"移动端H5");

    /**
     * 状态
     */
    private Integer type;
    /**
     * 状态描述
     */
    private String desc;

    /**
     * 通过type获取
     *
     * @param type 类型
     * @return 邮箱内容枚举
     */
    public static EmailContentEnum getByType(Integer type) {
        return Stream.of(values()).filter(s -> s.getType().equals(type)).findFirst().orElse(null);
    }

}
